/* fflush example */
#include <stdio.h>

char mybuffer[80];

int main()
{
   FILE *pFile;
   pFile = fopen("example.txt", "r+");
   if (pFile == NULL) 
     perror("Error opening file");
   else {
     fputs("test", pFile);
     fflush(pFile);    // flushing or repositioning required
     fgets(mybuffer, 80, pFile);
     puts(mybuffer);
     fclose(pFile);
  }
  
  return 0;
}
